package com.kehutong.auth.entity;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

import org.coraframework.json.annotation.JSONField;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;

import com.kehutong.auth.enums.AccountStatus;
import com.kehutong.common.enums.Gender;
import com.kehutong.common.enums.UserType;

/**
 * 员工相关账号
 * @author liuzhen
 */
@Table("t_user")
public class User extends Entity {

	private static final long serialVersionUID = 1L;

	protected User(String id) {
		super(id);
	}
	
	@Column(comment = "公司编号")
	private String corpNo;
	
	@Column(comment = "公司名称")
	private String corpName;
	
	@Column(comment = "登录账号")
	private String login_name;
	
	@Column(comment = "登录密码")
	@JSONField(deserialize = false, serialize = false)
	private String password;

	@Column(comment = "员工工号")
	private String no;
	
	@Column(comment = "姓名")
	private String name;

	@Column(length = 127, comment = "企微账号")
	private String userId;
	
	@Column(length = 255, comment = "头像")
	private String avatar;

	@Column(length = 255, comment = "个性签名")
	private String sign;

    @Column(length = 127, comment = "微信")
	private String weChat;

	@Column(comment = "所在地区", length=127)
	private List<String> areaIds;

	@Column(comment = "所在地区名称", length=127)
	private List<String> areaNames;
	
	@Column(comment = "性别")
	private Gender gender;

	@Column(comment = "手机号码")
	private String mobile;
	
	@Column(comment = "生日")
	private String birthday;
	
	@Column(comment = "电子邮箱")
	private String email;

	@Column(comment = "用户类型")
	private UserType user_type;

	@Column(comment = "最后登陆IP")
	private String login_ip;
	
	@Column(length=2048, comment = "账号关联企业")
	private Set<String> roles;

	@Column(comment = "最后登陆日期")
	private LocalDateTime login_date;

	@Column(comment = "状态")
    private AccountStatus status;
	
	@Column(comment = "逻辑删除")
	private boolean deleted;

	@Column(comment = "上次提醒时间")
	private Timestamp remindTime;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public String getCorpNo() {
		return corpNo;
	}

	public void setCorpNo(String corpNo) {
		this.corpNo = corpNo;
	}

	public String getCorpName() {
		return corpName;
	}

	public void setCorpName(String corpName) {
		this.corpName = corpName;
	}

	public String getLogin_name() {
		return login_name;
	}

	public void setLogin_name(String login_name) {
		this.login_name = login_name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public UserType getUser_type() {
		return user_type;
	}

	public void setUser_type(UserType user_type) {
		this.user_type = user_type;
	}

	public String getLogin_ip() {
		return login_ip;
	}

	public void setLogin_ip(String login_ip) {
		this.login_ip = login_ip;
	}

	public Set<String> getRoles() {
		return roles;
	}

	public void setRoles(Set<String> roles) {
		this.roles = roles;
	}

	public LocalDateTime getLogin_date() {
		return login_date;
	}

	public void setLogin_date(LocalDateTime login_date) {
		this.login_date = login_date;
	}

	public AccountStatus getStatus() {
		return status;
	}

	public void setStatus(AccountStatus status) {
		this.status = status;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public List<String> getAreaIds() {
		return areaIds;
	}

	public void setAreaIds(List<String> areaIds) {
		this.areaIds = areaIds;
	}

	public List<String> getAreaNames() {
		return areaNames;
	}

	public void setAreaNames(List<String> areaNames) {
		this.areaNames = areaNames;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

    public String getWeChat() {
        return weChat;
    }

    public void setWeChat(String weChat) {
        this.weChat = weChat;
    }

	public Timestamp getRemindTime() {
		return remindTime;
	}

	public void setRemindTime(Timestamp remindTime) {
		this.remindTime = remindTime;
	}
}